<template>
    <h1 id="son">我是孙子组件{{car.name}}</h1>
</template>

<script>

    import { ref, reactive, inject } from 'vue'
    //引用对象
    export default {

        setup() {

            const car = inject('car')



            return {
                car
            }
        }

    }

</script>

<style>
    #son {
        background-color: gray;
    }
</style>